<?php


class Login_Form_ForgotPassword extends WSB_Xtension_Form
{

	/**
	 * Initialisierung
	 */
	public function init()
    {
    	$this->setName('forgot-password');

    	// Action
    	$element = new Zend_Form_Element_Hidden('action');
    	$element->setValue('sendpassword');
    	$element->setDecorators($this->hiddenDecorators);
    	$this->addElement($element);

    	// E-Mail
        $element = new Zend_Form_Element_Text('email');
        $element->setLabel('loginEmail');
        $element->setRequired(true);
        $element->setAutoInsertNotEmptyValidator(false);
        $notEmptyValidator = new Zend_Validate_NotEmpty();
        $notEmptyValidator->setMessages(array(
        	'isEmpty' => 'loginEmailIsEmpty'
        ));
        $element->addValidator($notEmptyValidator, true);
        $emailValidator = new WSB_Validator_EmailAddressSimple();
		$emailValidator->setMessages(array(
			WSB_Validator_EmailAddressSimple::INVALID => 'loginInvalidEmail'
    	));
        $element->addValidator($emailValidator);
        $element->addFilter(new Zend_Filter_StringTrim());
		$this->addElement($element);

    	// Button
        $element = new Zend_Form_Element_Submit('btnSendInfoMail');
        $element->setLabel('loginSendInfoMail');
        $element->setAttrib('class', 'submit-button-save');
		$this->addElement($element);

    }

}
